package com.attilax.sms;
 
import com.attilax.corePkg.RandomX;
import com.attilax.lang.Global;
import com.google.inject.Inject;

/**
 * com.attilax.sms.SmsCaptcha
 * @author Administrator
 *
 */
public class SmsCaptcha {

	@Inject
	SmsService smsSrv;
	//@Inject
	RandomX  rdmx=new RandomX();
	public static void main(String[] args) {
		System.out.println( new SmsCaptcha().send("18573344543", "xxcontent"));

	}
	
	public String send(String mobile, String content) {
		int rdm= new RandomX().randomNum(1000, 9999);
		
		content=content.replace("$capt$",String.valueOf(rdm));
	//	if(smsSrv==null)
			Sms1xinxi	smsSrv=new Sms1xinxi();
	String send = smsSrv.send(mobile,content);
	Global.req.get().getSession().setAttribute("capt", String.valueOf(rdm));
	return	send;
	}

}
